#ifndef ABSTRACTACTION_H
#define ABSTRACTACTION_H
#include <QObject>
#include <QImage>
#include "Ptr.hpp"



using namespace OOPUtils;


class Work;


class AbstractAction : public QObject
{

  Q_OBJECT

protected:

  Ptr< Work > __pTargetWork;

public:

  AbstractAction (Ptr< Work > pTargetWork) : __pTargetWork (pTargetWork) {}

  AbstractAction () {}

  virtual void handleStartEvent () = 0;

  void startAction (Ptr< Work > pTargetWork)
  {
    __pTargetWork = pTargetWork;
    handleStartEvent ();
  }

  void startAction ()
  {
	  handleStartEvent ();
  }

  virtual void applyAction () = 0;

  virtual void rejectAction () = 0;

  virtual void updatePreview (QRect viewport) = 0;

};



#endif // ABSTRACTACTION_H